import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;

public class TestBytes {


    public static void main(String[] args) {
        String str = "liuyingna冯";
        byte[] fyjBytes = str.getBytes();
        String str1 = new String(fyjBytes);
        String encoding = Charset.defaultCharset().name();
        System.out.println("encod:" + encoding);
        if (str.equals(str1)) {
            System.out.println("通过");
        }

        byte tt = (byte) (128 + 40);
        System.out.println("before change tt :" + (tt - 40));
        int a = tt & 0xff ;

        System.out.println("after change tt :" + a);

        System.out.println("equals:" + (255 == a));
        System.out.println("tt == a " + (a == tt ? true : false));
        System.out.println("+8615998102718".replaceAll("\\D",""));
        System.out.println("contactName:" + getContactName("8615998102718","F8:C3:CC:07:8F:66"));

        int count = 0,index = 20;
        while(index > 0) {
            System.out.println("test count " + (count ++ % 8));
            index --;
        }


    }

    private static String getContactName(String num, String deviceName) {
        return num.replace("+86","") + "_" + deviceName;
    }
}
